package com.knife.bbs.business;

import java.util.List;

import com.knife.web.tools.DbPageList;
import com.knife.web.tools.IPageList;
import com.knife.bbs.domain.FilterWords;


public class FilterWordsService extends DAOSupportService {
	public List queryFilterWords(String scope){	
		return this.dao.query(FilterWords.class,scope);
	}	
	
	public   FilterWords getFilterWords(String id){
		
		return (FilterWords)this.dao.get(FilterWords.class,id);
	}
	
	public  FilterWords readFilterWordsByWord(String word){
		
		return (FilterWords)this.dao.getBy(FilterWords.class,"word",word);
	}	
	public  boolean isDulpWord(String fw){
		List banWords = queryFilterWords("1=1");
		FilterWords fws=readFilterWordsByWord(fw);
		if(banWords.contains(fws)) return true;
		return false;
	}

	public  IPageList queryWords(String scope, int pageSize, int pageNo) {
		DbPageList pList = new DbPageList(FilterWords.class, scope, null);
		pList.doList(pageNo, pageSize);
		return pList;
	}
}
